/*
package com.mycat.manager.controller.file;

import com.mycat.common.entity.InvokeResult;
import com.mycat.dfs.server.FastDFSService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

*/
/**
 * 文件上传相关
 *
 * @author roger.
 * @email luojie@yzworld.cn
 * @date 2016/10/8
 *//*

@RestController
@RequestMapping("/file")
public class FileController {
    private static Logger logger = LoggerFactory.getLogger(FileController.class);

    */
/**
     * 文件服务器
     *//*

    @Autowired
    private FastDFSService fastDFSService;

    */
/**
     * 文件上传
     *
     * @param file MultipartFile
     *//*

    @RequestMapping(value = "/uploads", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    @RequiresPermissions("file:upload")
    @ResponseBody
    public ResponseEntity<InvokeResult> handleFileUpload(@RequestParam("file") MultipartFile file) {
        InvokeResult invokeResult = null;
        try {
            if (null != file) {
                final String fileName = file.getOriginalFilename(); // 原始图片名
                // 文件扩展名
                String extName = fileName.substring(fileName.indexOf(".") + 1);
                // 上传文件并返回地址
                String url = fastDFSService.uploadFile(file.getInputStream(), extName);
                invokeResult = InvokeResult.success(url);
            }
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            invokeResult = InvokeResult.failure("文件上传出现异常");
        }
        return new ResponseEntity(invokeResult, HttpStatus.valueOf(invokeResult.getCode()));
    }
}
*/
